﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="{x:Type RepeatButton}">
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
        <Setter Property="Background" Value="{DynamicResource ButtonBackgroundThemeBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderThemeBrush}" />
        <Setter Property="BorderThickness" Value="{DynamicResource RepeatButtonBorderThemeThickness}" />
        <Setter Property="Padding" Value="12,4,12,5" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <Grid SnapsToDevicePixels="True">
                        <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="3">
                            <ContentControl x:Name="ContentPresenter" Content="{TemplateBinding Content}"  ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Stroke="{DynamicResource FocusVisualWhiteStrokeThemeBrush}" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="1.5" />
                        <Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Stroke="{DynamicResource FocusVisualBlackStrokeThemeBrush}" StrokeEndLineCap="Square" StrokeDashArray="1,1" Opacity="0" StrokeDashOffset="0.5" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="FocusVisualWhite" Property="Opacity" Value="1" />
                            <Setter TargetName="FocusVisualBlack" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource RepeatButtonPointerOverBackgroundThemeBrush}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonPointerOverForegroundThemeBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource RepeatButtonPressedBackgroundThemeBrush}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonPressedForegroundThemeBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource RepeatButtonDisabledBackgroundThemeBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource RepeatButtonDisabledBorderThemeBrush}" />
                            <Setter TargetName="ContentPresenter" Property="Foreground" Value="{DynamicResource RepeatButtonDisabledForegroundThemeBrush}" />
                        </Trigger>
                        <Trigger Property="Validation.HasError" Value="True">
                            <Setter TargetName="FocusVisualWhite" Property="Opacity" Value="1" />
                            <Setter TargetName="FocusVisualBlack" Property="Opacity" Value="1" />
                            <Setter TargetName="FocusVisualWhite" Property="Stroke" Value="{DynamicResource ControlValidationInvalidThemeBrush}" />
                            <Setter TargetName="FocusVisualBlack" Property="Stroke" Value="{DynamicResource ControlValidationInvalidThemeBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>